package com.hgw.Demo02_FactoryMethod.factory_method;



/**
 * Data time:2021/12/11 16:23
 * StudentID:2019112118
 * Author:hgw
 * Description: 测试
 */
public class Client {
    public static void main(String[] args) {
        // 创建咖啡店类对象
        CoffeeStore coffeeStore = new CoffeeStore();
        // 创建对象
        CoffeeFactory factory = new AmericanCoffeeFactory();

        coffeeStore.setFactory(factory);

        // 点咖啡
        Coffee coffee = coffeeStore.orderCoffee();
        System.out.println(coffee.getName());
    }
}
